package com.inca.shop.order.fegin;

import com.alibaba.fastjson.JSONObject;
import com.inca.shop.bean.Product;
import com.inca.shop.bean.User;
import com.inca.shop.order.fegin.fallback.ProductServiceFallBack;
import com.inca.shop.order.fegin.fallback.factory.ProductServiceFallBackFactory;
import com.inca.shop.utils.constants.HttpCode;
import com.inca.shop.utils.resp.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "server-product", path = "/product", fallback = ProductServiceFallBack.class)
//@FeignClient(value = "server-product", path = "/product", fallback = ProductServiceFallBackFactory.class)
public interface ProductService {

    @GetMapping(value = "/get/{pid}")
    Product getProduct(@PathVariable("pid") Long pid);

    @GetMapping(value = "/update_count/{pid}/{count}")
    Result<Integer> updateCount(@PathVariable("pid") Long pid, @PathVariable("count") Integer count);
}
